class Solution {
public:
    int finalValueAfterOperations(vector<string>& operations) {
        
        int nRet=0;
        for(int i=0;i<operations.size();++i){
            if(operations[i]=="X++" || operations[i]=="++X"){
                ++nRet;
            }
            else if(operations[i]=="X--" || operations[i]=="--X"){
                --nRet;
            }
        }

        return nRet;
    }
};
